\(\int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx\) [6]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 15 \[ \int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx=-\frac {x}{a}-\frac {\text {arctanh}(\cos (x))}{a} \]

[Out]

-x/a-arctanh(cos(x))/a

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3973, 3855} \[ \int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx=-\frac {\text {arctanh}(\cos (x))}{a}-\frac {x}{a} \]

[In]

Int[Cot[x]^2/(a + a*Csc[x]),x]

[Out]

-(x/a) - ArcTanh[Cos[x]]/a

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3973

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\int (-a+a \csc (x)) \, dx}{a^2} \\ & = -\frac {x}{a}+\frac {\int \csc (x) \, dx}{a} \\ & = -\frac {x}{a}-\frac {\text {arctanh}(\cos (x))}{a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 30, normalized size of antiderivative = 2.00 \[ \int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx=-\frac {x}{a}-\frac {\log \left (\cos \left (\frac {x}{2}\right )\right )}{a}+\frac {\log \left (\sin \left (\frac {x}{2}\right )\right )}{a} \]

[In]

Integrate[Cot[x]^2/(a + a*Csc[x]),x]

[Out]

-(x/a) - Log[Cos[x/2]]/a + Log[Sin[x/2]]/a

Maple [A] (verified)

Time = 0.41 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.20

method result size
default \(\frac {-2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )+\ln \left (\tan \left (\frac {x}{2}\right )\right )}{a}\) \(18\)
risch \(-\frac {x}{a}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{a}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{a}\) \(33\)

[In]

int(cot(x)^2/(a+a*csc(x)),x,method=_RETURNVERBOSE)

[Out]

1/a*(-2*arctan(tan(1/2*x))+ln(tan(1/2*x)))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.67 \[ \int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx=-\frac {2 \, x + \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, a} \]

[In]

integrate(cot(x)^2/(a+a*csc(x)),x, algorithm="fricas")

[Out]

-1/2*(2*x + log(1/2*cos(x) + 1/2) - log(-1/2*cos(x) + 1/2))/a

Sympy [F]

\[ \int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx=\frac {\int \frac {\cot ^{2}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \]

[In]

integrate(cot(x)**2/(a+a*csc(x)),x)

[Out]

Integral(cot(x)**2/(csc(x) + 1), x)/a

Maxima [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 30, normalized size of antiderivative = 2.00 \[ \int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx=-\frac {2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} + \frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} \]

[In]

integrate(cot(x)^2/(a+a*csc(x)),x, algorithm="maxima")

[Out]

-2*arctan(sin(x)/(cos(x) + 1))/a + log(sin(x)/(cos(x) + 1))/a

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.13 \[ \int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx=-\frac {x}{a} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{a} \]

[In]

integrate(cot(x)^2/(a+a*csc(x)),x, algorithm="giac")

[Out]

-x/a + log(abs(tan(1/2*x)))/a

Mupad [B] (verification not implemented)

Time = 18.87 (sec) , antiderivative size = 45, normalized size of antiderivative = 3.00 \[ \int \frac {\cot ^2(x)}{a+a \csc (x)} \, dx=\frac {2\,\mathrm {atan}\left (\frac {4}{4\,\mathrm {tan}\left (\frac {x}{2}\right )+4}-\frac {4\,\mathrm {tan}\left (\frac {x}{2}\right )}{4\,\mathrm {tan}\left (\frac {x}{2}\right )+4}\right )}{a}+\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a} \]

[In]

int(cot(x)^2/(a + a/sin(x)),x)

[Out]

(2*atan(4/(4*tan(x/2) + 4) - (4*tan(x/2))/(4*tan(x/2) + 4)))/a + log(tan(x/2))/a